/*============================================================================*/
/*                   CONTINENTAL AUTOMOTIVE SYSTEMS                           */
/*============================================================================*/
/*                        OBJECT SPECIFICATION                                */
/*============================================================================*
* name:            HAL_Button.h
* version:         1.0
* created_by:      Alejandro Ruiz
* date_created:    June 22 2013
*=============================================================================*/
/* DESCRIPTION : Header file for abstraction layer for BUTTON                 */
/*============================================================================*/
/* FUNCTION COMMENT : Header file abstraction layer for BUTTON                */
/*                                                                            */
/*============================================================================*/
/*                               OBJECT HISTORY                               */
/*============================================================================*/
/*  REVISION |   DATE      |                               |      AUTHOR      */
/*----------------------------------------------------------------------------*/
/*  1.0      | 22/jun/2013 |                               | Alejandro Ruiz   */
/* Initial version for Ale Window Lifter using Freescale Bolero micro.        */
/*============================================================================*/

#ifndef HAL_BUTTON_H                                /* To avoid double inclusion */
#define HAL_BUTTON_H

/* Register definitions for selected microcontroller */
#include "MCU_derivative.h"

/*-- Defines -----------------------------------------------------------------*/
#define BUTTON_UP      		 PIN_PE0
#define BUTTON_DOWN    		 PIN_PE1
#define BUTTON_ANTIPINCH     PIN_PE2

#define BUTTON_PRESSED       0u

typedef enum
{
        NO_ONE,
        INVALID,
        CONTINUOUS_UP,
		ONETOUCH_UP,
		CONTINUOUS_DOWN,
		ONETOUCH_DOWN,
		ANTIPINCH
}E_BUTTON_FUNC;    /* States for SELECTOR */


/*-- Functions ---------------------------------------------------------------*/

void HAL_Button_Init(void);
void HAL_Button_ReadButton(T_UBYTE lub_Channel, PTR_UBYTE lpub_Value);
void HAL_Button_ValidButton(PTR_UBYTE lpub_Value);


#endif